//
//  CZMyTaskCell.m
//  nsj_iOS
//
//  Created by apple on 2017/1/24.
//  Copyright © 2017年 GCZ. All rights reserved.
//

#import "CZMyTaskCell.h"

@implementation CZMyTaskCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setStarsWithNumber:(NSInteger)number {
    for (UIView *view in self.contentView.subviews) {
        if (view.tag > 999) {
            [view removeFromSuperview];
        }
    }
    UIImageView *lastView;
    for (int i = 0; i < number; i ++) {
        UIImageView *imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:imgView];
        imgView.image = [UIImage imageNamed:@"icon_star"];
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.equalTo(@12);
            make.centerY.equalTo(self.taskLimitLabel).offset(-1);
            make.left.equalTo(lastView ? lastView.mas_right : self.taskLimitLabel.mas_right).offset(5);
        }];
        imgView.tag = 1000+i;
        lastView = imgView;
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
